 {extend name="layout:base" /}{block name="content"}

 <?php
$global=isSupperManagerForSession();
 ?>
 <link rel="stylesheet" type="text/css" href="/static/My97DatePicker/skin/WdatePicker.css" />
     <script charset="utf-8" src="/static/My97DatePicker/WdatePicker.js"></script>
 <style type="text/css">
     .yg_inp>input{margin-bottom: 10px;}
     #zc_detail table{margin:10px;}
     #zc_detail table tr td{border: 1px solid #ddd;height:40px;line-height:40px;padding-left:5px;padding-right:5px;}
     .ordertable input {width:90%;}
     .policeLable{padding:2px 4px;margin-left:4px;}
     #taskDate .taskDateItem{width:100%;height:40px;line-height:40px;margin:4px 0px;}
     #taskDate .taskDateItem .taskDateItemLeft{width:10%;float:left;}
     #taskDate .taskDateItem .taskDateItemRight1{width:70%;float:left;border:1px solid #139667;height: 42px;}
     #taskDate .taskDateItem .taskDateItemRight2{width:20%;float:right;}
     #taskDate .taskDateItem .opUsers img{width:22px;margin-left:5px;}
     #taskDate .taskDateItem .itemUser{padding: 4px 6px;background:#139667;margin-left:4px;color:white;}
     #taskDate .taskDateItem .clear{clear:both;width:0px;height:0px;overflow:hidden;}
     #taskDate .taskDateItem .jia,#taskDate .taskDateItem .jian{font-size:30px;cursor:pointer;font-weight:800;margin-left:5px;}

     #box{ margin:10px auto; width:98%; min-height:400px; background:#efefef}
     .imageLists{width:98%;margin-left:auto;margin-right:auto;}
     .imageLists .imageItem{width:100px;height:80px;float:left;margin-left:10px;}
     .imageLists .imageItem img{width:80px;margin-left:10px;overflow:hidden;}
     .fileLists{width:98%;margin-left:auto;margin-right:auto;}
     .fileLists .fileItem{width:100%;}

 </style>
<link rel="stylesheet" type="text/css" href="/static/imageUpload/diyUpload/css/webuploader.css">
<link rel="stylesheet" type="text/css" href="/static/imageUpload/diyUpload/css/diyUpload.css">
<script type="text/javascript" src="/static/imageUpload/diyUpload/js/webuploader.html5only.min.js"></script>
<script type="text/javascript" src="/static/imageUpload/diyUpload/js/diyUpload.js"></script>

 
<section class="topBanners">
         <div class="icon"></div>
         <div class="topBannersNav">
        <span data-url="/admin/notesthink/lists" onclick="ContentLoadGo('/admin/notesthink/lists')">想法管理</span>
        >
        <span data-url="/admin/notesthink/addFiles"  onclick="ContentLoadGo('/admin/notesthink/addFiles?pid=<?php echo $pid; ?>')"  >添加附件</span>
         </div>
      </section>
 <section id="zc_detail">

<div id="box">
	<div id="test" ></div>
</div>
<span style="display:block;margin-left:auto;margin-right:auto;width:100px;background-color:#3d7ba8;height:40px;line-height:40px;text-align:center;color:white;" onclick="history.back();">返回列表</span>
 </section>
 <table class="table" style="margin-top:10px;">
     <tr>
         <th style="width:50px;">ID</th>
         <th style="width:100px;">类型</th>
         <th style="width:50px;">文件</th>
         <th style="width:100px;">时间</th>
         <th style="width:100px;">排序</th>
         <th style="width:120px;">操作</th>
     </tr>
     <?php
foreach($FileLists as $key=>$val)
     {
     ?>
     <tr data-id="<?php echo $val['id']; ?>">
         <td style="text-align:left;"><?php echo $val['id']; ?></td>
         <td style="text-align:left;">
             <?php
            $string = "";
            if($val['ty']==1)
            {
                $string="图片";
            }else if($val['ty']==2)
            {
                $string="音频/视频";
            }else if($val['ty']==3)
            {
                $string="文档";
            }
            echo $string;
            ?>
         </td>
         <td>
             <?php
            if($val['ty']==1)
            {
            ?>
             <img src="<?php echo $val['file']; ?>" style="max-width:50px;" />
             <?php
            }else if($val['ty']==2)
            {
                echo $val['file'];
            }else if($val['ty']==3)
            {
                echo $val['file'];
            }

            ?>

         </td>
         <td><?php echo formateDate($val['ctime']);?></td>
         <td><input type="text" style="width:98%;margin-left:0px;" class="sorts" name="sorts" value="<?php echo $val['sorts']; ?>"  /></td>
         <td style="text-align:right;">
             <?php
            if( ( in_array(30400,$ruleLists) || $global==1) )
            {
            ?>
             <input type="button" power="30400" value="删除" class="link_btn del"/>
             <?php
            }
            ?>
         </td>
     </tr>

     <?php
}
?>
 </table>
 <div style="with:100%;height:20px;"></div>
     
       <script type="text/javascript">
           $(function(){
               $(".sorts").blur(function(){
                   var sorts = $(this).val();
                   var id=$(this).parent().parent().attr("data-id");
                   var url="/admin/notesthink/fileSorts";
                   var param={
                       id:id,
                       sorts:sorts,
                       sys_opt:'edit'
                   };
                   AjaxRequest(url,param,function(data){
                       if(data.err==0)
                       {
                           //SuccessTiShi(data.msg);
                       }
                       else
                       {
                           ErrTiShi(data.msg);
                       }
                   });
               });

               $(".del").unbind().bind("click",function(){
                   var that =this;
                   var url="/admin/notesthink/delFilesData";
                   var id=$(that).parent().parent().attr('data-id');
                   var param={
                       id:id
                   };
                   cofirmsss_tishi(1,'您确定要删除吗?',function(id){

                       AjaxRequest(url,param,function(data){
                           if(data.err==0)
                           {
                               SuccessTiShi("操作成功");
                               $(that).parent().parent().remove();
                           }
                           else
                           {
                               ErrTiShi("操作失败");
                           }
                       });

                   });
               });
        	   $('#test').diyUpload({
	        	   	url:'/admin/notesthink/plAddData?pid=<?php echo $pid ?>',
	        	   	success:function( data ) {
	        	   		console.info( data );
	        	   	},
	        	   	error:function( err ) {
	        	   		console.info( err );	
	        	   	},
                   buttonText : '选择文件',
                   chunked:true,
                   // 分片大小
                   chunkSize:512 * 1024,
                   //最大上传的文件数量, 总文件大小,单个文件大小(单位字节);
                   fileNumLimit:50,
                   fileSizeLimit:500000 * 1024*10,
                   fileSingleSizeLimit:50000 * 1024 *10,
                   accept: {}
        	   });
  				$("#all").click(function(){   
			    	if(this.checked){   
			        	$(".checkBoxInput").attr("checked", true);  
			        	$(".checkBoxInput").prop("checked", true);  
			    	}else{   
						$(".checkBoxInput").attr("checked", false);
						$(".checkBoxInput").prop("checked", false);
			    	}   
			    	var se=getAllSelectItem();
			    	//console.log(se);
			 	}); 
  				 //导航
         	   $(".topBannerItem").click(function(){
         		   var attArr = $(this).attr();
             	   goToSelfLink(attArr);
         	   });
  			   
           });
           
	  </script>
	  	  
	  {/block}
	  